//
//  UILabel+Extension.m
//  CSJExample
//
//  Created by ya on 12/7/16.
//  Copyright © 2016 ya. All rights reserved.
//

#import "UILabel+Extension.h"

@implementation UILabel (Extension)

// MARK: -----------------------<-Begin->-----------------------

/// Text, textAlignment default is center, numberOfLines default is 0.
+ (instancetype)sj_createLabelWithText:(NSString *)text {

    UILabel *label = [[UILabel alloc] init];
    label.text = text;
    label.textAlignment = NSTextAlignmentCenter;
    label.numberOfLines = 0;
    return label;
}

/// Text, FontSize
+ (instancetype)sj_createLabelWithText:(NSString *)text
                              fontSize:(CGFloat)fontSize
                                  blod:(BOOL)isBlod {

    UILabel *label = [self sj_createLabelWithText:text];
    if (isBlod) {
        label.font = [UIFont boldSystemFontOfSize:fontSize];
    } else {
        label.font = [UIFont systemFontOfSize:fontSize];
    }
    return label;
}

/// Text, FontSize, TextColor
+ (instancetype)sj_createLabelWithText:(NSString *)text
                              fontSize:(CGFloat)fontSize
                                  blod:(BOOL)isBlod
                             textColor:(UIColor *)textColor {

    UILabel *label = [self sj_createLabelWithText:text
                                         fontSize:fontSize
                                             blod:isBlod];
    label.textColor = textColor;
    return label;
}

/// Text, FontSize, TextColor, backgroundColor
+ (instancetype)sj_createLabelWithText:(NSString *)text
                              fontSize:(CGFloat)fontSize
                                  blod:(BOOL)isBlod
                             textColor:(UIColor *)textColor
                       backgroundColor:(UIColor *)backgroundColor {

    UILabel *label = [self sj_createLabelWithText:text
                                         fontSize:fontSize
                                             blod:isBlod
                                        textColor:textColor];
    label.backgroundColor = backgroundColor;
    return label;
}
  

/// all property, used for reference. no implementation.
+ (instancetype)createLabelWithText:(NSString *)text
                               font:(UIFont *)font
                          textColor:(UIColor *)textColor
                        shadowColor:(UIColor *)shadowColor
                       shadowOffset:(CGSize)shadowOffset
                      textAlignment:(NSTextAlignment)textAlignment
                      lineBreakMode:(NSLineBreakMode)lineBreakMode
                     attributedText:(NSAttributedString *)attributedText
               highlightedTextColor:(UIColor *)highlightedTextColor
                        highlighted:(BOOL)highlighted
             userInteractionEnabled:(BOOL)userInteractionEnabled
                            enabled:(BOOL)enabled
                      numberOfLines:(NSInteger)numberOfLines
          adjustsFontSizeToFitWidth:(BOOL)adjustsFontSizeToFitWidth
                 baselineAdjustment:(UIBaselineAdjustment)baselineAdjustment
                 minimumScaleFactor:(CGFloat)minimumScaleFactor
allowsDefaultTighteningForTruncation:(BOOL)allowsDefaultTighteningForTruncation
            preferredMaxLayoutWidth:(CGFloat)preferredMaxLayoutWidth
                    minimumFontSize:(CGFloat)minimumFontSize
     adjustsLetterSpacingToFitWidth:(BOOL)adjustsLetterSpacingToFitWidth {
    return nil;
}
@end
